const router = require('koa-router')();
const {checkUsername, doRegister, doLogin, getPic, logout} = require('../controller/user');

router.prefix('/user');

router.get('/register', async (ctx, next) => await ctx.render('register'));

router.get('/login', async (ctx, next) => await ctx.render('login'));

router.post('/checkUsername', checkUsername);

router.post('/doRegister', doRegister);

router.post('/doLogin', doLogin);

router.get('/getPic', getPic);

router.get('/logout', logout);

module.exports = router;
